<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登录页面</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="css/login.css">
	<script type="text/javascript" src="<%=basePath%>js/jquery-easyui-1.3.5/jquery.min.js"></script>
</head>
<script type="text/javascript">
	$(document).ready(function(){ 
	<c:if test="${error !=null && error !=''}">
			$("#msg").html('<span><c:out value="${error}"/></span>');
	</c:if>
	<c:if test="${info != null && info!=''}">
			$("#msg").html('<span><c:out value="${info}"/></span>');
	</c:if>
	});
	function do_submit(){
		var username = $("#username").val();
		var password = $("#password").val();
		if(username != null && username!='' && password != null && password!=''){
			$("#form").submit();
		}else{
			$("#msg").html('<span>用户名或密码不能为空</span>');
		}
	}
</script>
<body>
<div id="container">
		<form id="form" action="<%=basePath%>user/login" method="post">
			<div id="main">
			<input type="text" name="username" id="username" value="<c:out value="${username}" />">
			<input class="second" type="password" name="password" id="password" value="<c:out value="${password}" />">
		<div id="msg" ></div>
			</div>
		<div id="btn">
			<input class="login" type="button" onclick="do_submit()" value="">
			<input class="cancel" type="button" value="">
			<a href="<%=basePath%>register">注册</a>
		</div>
		</form>
	</div>
</body>
</html>